home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Technical Documentation / C.S.M.P. Digests / csmp-digest-v3-034 / doubleCR.1 < prev   
Encoding:
Text File  |  1994-07-07  |  66.3 KB  |  1,787 lines

  1. C.S.M.P. Digest             Sun, 12 Jun 94       Volume 3 : Issue 34
  2.  
  3. Today's Topics:
  4.  
  5.         32-Bit Addressing
  6.         AppleScript Questions
  7.         Code Warrior allocation of Objects
  8.         Code Warrior: ruminations of a long-time MPW user
  9.         Refinement of SC++ 7.0 code gen bug
  10.         Serial Port Programming?
  11.         Serial port use
  12.         THINK Class Library FTP Site?
  13.         storage for XCMDS
  14.  
  15.  
  16.  
  17. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  18. (pottier@clipper.ens.fr).
  19.  
  20. The digest is a collection of article threads from the internet newsgroup
  21. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  22. regularly and want an archive of the discussions.  If you don't know what a
  23. newsgroup is, you probably don't have access to it.  Ask your systems
  24. administrator(s) for details.  If you don't have access to news, you may
  25. still be able to post messages to the group by using a mail server like
  26. anon.penet.fi (mail help@anon.penet.fi for more information).
  27.  
  28. Each issue of the digest contains one or more sets of articles (called
  29. threads), with each set corresponding to a 'discussion' of a particular
  30. subject.  The articles are not edited; all articles included in this digest
  31. are in their original posted form (as received by our news server at
  32. nef.ens.fr).  Article threads are not added to the digest until the last
  33. article added to the thread is at least two weeks old (this is to ensure that
  34. the thread is dead before adding it to the digest).  Article threads that
  35. consist of only one message are generally not included in the digest.
  36.  
  37. The digest is officially distributed by two means, by email and ftp.
  38.  
  39. If you want to receive the digest by mail, send email to listserv@ens.fr
  40. with no subject and one of the following commands as body:
  41.     help                        Sends you a summary of commands
  42.     subscribe csmp-digest Your Name    Adds you to the mailing list
  43.     signoff csmp-digest            Removes you from the list
  44. Once you have subscribed, you will automatically receive each new
  45. issue as it is created.
  46.  
  47. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  48. Questions related to the ftp site should be directed to
  49. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  50. digest are available there.
  51.  
  52. Also, the digests are available to WAIS users.  To search back issues
  53. with WAIS, use comp.sys.mac.programmer.src. With Mosaic, use
  54. http://www.wais.com/wais-dbs/comp.sys.mac.programmer.html.
  55.  
  56.  
  57. -------------------------------------------------------
  58.  
  59. >From spencerl@crl.com (Spencer Low)
  60. Subject: 32-Bit Addressing
  61. Date: 20 May 1994 18:43:48 -0700
  62. Organization: LowTek Creations
  63.  
  64. How do you detect whether 32-bit Addressing is enabled/disabled? Also, 
  65. how can you turn it on? I remember reading somewhere that there's a bit 
  66. in PRAM that you can modify. Does anyone have any specifics or sample 
  67. code (THINK C)? I realize that the Mac would be require to be rebooted, 
  68. but I would still like an automated way to turn it on (with the 
  69. authorization of the user).
  70.  
  71. Thanks,
  72. Spencer
  73.  
  74.  
  75. -- 
  76.   Spencer Low       | Creators of MaxRAM!!
  77.   LowTek Creations  | Anonymous FTP to crl.com and look in
  78.   spencerl@crl.com  | /users/ro/spencerl/ for more info.
  79.  
  80. +++++++++++++++++++++++++++
  81.  
  82. >From jwbaxter@olympus.net (John W. Baxter)
  83. Date: Fri, 20 May 1994 23:12:09 -0700
  84. Organization: Internet for the Olympic Peninsula
  85.  
  86. In article <2rjp0k$cqe@crl2.crl.com>, spencerl@crl.com (Spencer Low) wrote:
  87.  
  88. > How do you detect whether 32-bit Addressing is enabled/disabled? Also, 
  89. > how can you turn it on? I remember reading somewhere that there's a bit 
  90. > in PRAM that you can modify. Does anyone have any specifics or sample 
  91. > code (THINK C)? I realize that the Mac would be require to be rebooted, 
  92. > but I would still like an automated way to turn it on (with the 
  93. > authorization of the user).
  94.  
  95. Send a 4 byte -1 through the StripAddress trap, and see what comes out.
  96. -- 
  97. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  98.    jwbaxter@pt.olympus.net
  99.  
  100. +++++++++++++++++++++++++++
  101.  
  102. >From spencerl@crl.com (Spencer Low)
  103. Date: 21 May 1994 00:08:14 -0700
  104. Organization: LowTek Creations
  105.  
  106. John W. Baxter (jwbaxter@olympus.net) wrote:
  107. > Send a 4 byte -1 through the StripAddress trap, and see what comes out.
  108.  
  109. I just tried that and StripAddress returned 0xFFFFFFFF, or -1. What will 
  110. it return in 24-bit mode? 0x00FFFFFF?
  111.  
  112. I think I just answered my own question (well, part of it)... 
  113. GestaltEqu.h tells me that the gestaltAddressingModeAttr selector will 
  114. tell me about the addressing mode of the Mac. Just test for bit 0 
  115. (gestalt32BitAddressing).
  116.  
  117. So how do I turn it on? And I shouldn't turn it on if gestalt32BitCapable 
  118. is false?
  119.  
  120. Thanks,
  121. Spencer
  122. -- 
  123.   Spencer Low       | Creators of MaxRAM!!
  124.   LowTek Creations  | Anonymous FTP to crl.com and look in
  125.   spencerl@crl.com  | /users/ro/spencerl/ for more info.
  126.  
  127. +++++++++++++++++++++++++++
  128.  
  129. >From spencerl@crl.com (Spencer Low)
  130. Date: 21 May 1994 12:47:41 -0700
  131. Organization: LowTek Creations
  132.  
  133. Spencer Low (spencerl@crl.com, aka "me") wrote:
  134. > So how do I turn it on? And I shouldn't turn it on if gestalt32BitCapable 
  135. > is false?
  136.  
  137. I did soom searching on the 'net (the alt.sources.mac archive) and I 
  138. found out some information about extended PRAM (XPRAM) and memory 
  139. settings. I looked at the Extended PRAM Layout from Kiselyov Oleg 
  140. (oleg@ponder.csci.unt.edu) and I copied/composed the following code:
  141.  
  142. (THINK C style with inline assembly)
  143.  
  144. char    buffer;
  145.  
  146. asm {
  147.     LEA    buffer, A0    // pass the address as a parameter
  148.     MOVE.W    #1, D0        // the length of the data
  149.     SWAP    D0
  150.     MOVE.W    #0x8A, D0    // location in XPRAM
  151.     DC.W    0xA051        // ReadXPRam trap
  152. }
  153. BitSet( &buffer, 15 );    // Set xxxx x1x1 (should mean 32-bit on)
  154. BitSet( &buffer, 13 );
  155. asm {
  156.     LEA    buffer, A0    // pass the address as a parameter
  157.     MOVE.W    #1, D0        // the length of the data
  158.     SWAP    D0
  159.     MOVE.W    #0x8A, D0    // location in XPRAM
  160.     DC.W    0xA052        // WriteXPRam trap
  161. }
  162.  
  163. Kiselyov Oleg's info tells us the following:
  164.  
  165. Loc  Length
  166. (hex)  (dec)
  167. 8A      1               Bit field: Memory/cache control flags
  168.            1xxx xxxx    68040 Cache is OFF | Toggled through Cache control
  169.            0xxx xxxx    68040 Cache is ON  | panel
  170.            xxxx x1x1    32-bit addressing is ON (toggled through the Memory
  171.                         control panel)
  172.  
  173. So it seems like my code is setting the right stuff, correct? Does my 
  174. code make sense? I can't test it on my 660AV, since the 660AV doesn't 
  175. support 24-bit mode (or does it?). Also, I noticed that Kiselyov's info 
  176. says 1xxx xxxx means that the cache is off, but on my Mac, my cache is on 
  177. and ReadXPRam returns 1xxx xxxx. Is there a typo or something?
  178.  
  179. Thanks in advance for your help,
  180.  
  181. Spencer
  182. -- 
  183.   Spencer Low       | Creators of MaxRAM!!
  184.   LowTek Creations  | Anonymous FTP to crl.com and look in
  185.   spencerl@crl.com  | /users/ro/spencerl/ for more info.
  186.  
  187. +++++++++++++++++++++++++++
  188.  
  189. >From spencerl@crl.com (Spencer Low)
  190. Date: 21 May 1994 14:00:02 -0700
  191. Organization: LowTek Creations
  192.  
  193. Spencer Low (spencerl@crl.com) wrote:
  194. > BitSet( &buffer, 15 );    // Set xxxx x1x1 (should mean 32-bit on)
  195. > BitSet( &buffer, 13 );
  196.  
  197. Whoops! This code should be BitSet(&buffer, 5); & BitSet(&buffer, 7); 
  198. instead. (this is the first time I've ever used BitSet.)
  199.  
  200. > Kiselyov Oleg's info tells us the following:
  201.  
  202. > Loc  Length
  203. > (hex)  (dec)
  204. > 8A      1               Bit field: Memory/cache control flags
  205. >            1xxx xxxx    68040 Cache is OFF | Toggled through Cache control
  206. >            0xxx xxxx    68040 Cache is ON  | panel
  207. >            xxxx x1x1    32-bit addressing is ON (toggled through the Memory
  208. >                         control panel)
  209.  
  210. > So it seems like my code is setting the right stuff, correct? Does my 
  211. > code make sense? I can't test it on my 660AV, since the 660AV doesn't 
  212. > support 24-bit mode (or does it?). Also, I noticed that Kiselyov's info 
  213. > says 1xxx xxxx means that the cache is off, but on my Mac, my cache is on 
  214. > and ReadXPRam returns 1xxx xxxx. Is there a typo or something?
  215.  
  216. It seems like I was the one making the typo. I checked on my calculator 
  217. (conversions) and ReadXPRam was returning x1xx x1x1, meaning that 32-bit 
  218. addressing was on and the cache was on. I don't know what that second "1" 
  219. means, though. Perhaps it means that 32-bit can't be turned off?
  220.  
  221. Spencer
  222. -- 
  223.   Spencer Low       | Creators of MaxRAM!!
  224.   LowTek Creations  | Anonymous FTP to crl.com and look in
  225.   spencerl@crl.com  | /users/ro/spencerl/ for more info.
  226.  
  227. +++++++++++++++++++++++++++
  228.  
  229. >From jrb@mitre.org (Bob Boonstra)
  230. Date: Sun, 22 May 1994 07:37:29 -0500
  231. Organization: MITRE
  232.  
  233. In article <2rjp0k$cqe@crl2.crl.com>, spencerl@crl.com (Spencer Low) wrote:
  234.  
  235. > How do you detect whether 32-bit Addressing is enabled/disabled? Also, 
  236. > how can you turn it on?
  237.  
  238. mode = GetMMUMode();  /* returns false32b (0) or true32b (1) */
  239. SwapMMUMode(&mode);  /* sets addressing mode and returns old mode */
  240. -- 
  241. -- Bob Boonstra
  242. -- jrb@mitre.org
  243. -- My opinion, not my employer's
  244.  
  245. +++++++++++++++++++++++++++
  246.  
  247. >From spencerl@crl.com (Spencer Low)
  248. Date: 22 May 1994 12:56:20 -0700
  249. Organization: LowTek Creations
  250.  
  251. Bob Boonstra (jrb@mitre.org) wrote:
  252. > In article <2rjp0k$cqe@crl2.crl.com>, spencerl@crl.com (Spencer Low) wrote:
  253.  
  254. > > How do you detect whether 32-bit Addressing is enabled/disabled? Also, 
  255. > > how can you turn it on?
  256.  
  257. > mode = GetMMUMode();  /* returns false32b (0) or true32b (1) */
  258. > SwapMMUMode(&mode);  /* sets addressing mode and returns old mode */
  259.  
  260. Is this the same 32-bit mode that the Memory control panel controls? I 
  261. always thought that this was a different related thing. If there are 
  262. these routines, why do we have to reboot after changing the mode in the 
  263. Memory control panel?
  264.  
  265. Thanks,
  266. Spencer
  267. -- 
  268.   Spencer Low       | Creators of MaxRAM!!
  269.   LowTek Creations  | Anonymous FTP to crl.com and look in
  270.   spencerl@crl.com  | /users/ro/spencerl/ for more info.
  271.  
  272. +++++++++++++++++++++++++++
  273.  
  274. >From jwbaxter@olympus.net (John W. Baxter)
  275. Date: Mon, 23 May 1994 07:47:10 -0700
  276. Organization: Internet for the Olympic Peninsula
  277.  
  278. In article <2rodd4$99s@crl2.crl.com>, spencerl@crl.com (Spencer Low) wrote:
  279.  
  280. > Bob Boonstra (jrb@mitre.org) wrote:
  281. > > In article <2rjp0k$cqe@crl2.crl.com>, spencerl@crl.com (Spencer Low) wrote:
  282. > > > How do you detect whether 32-bit Addressing is enabled/disabled? Also, 
  283. > > > how can you turn it on?
  284. > > mode = GetMMUMode();  /* returns false32b (0) or true32b (1) */
  285. > > SwapMMUMode(&mode);  /* sets addressing mode and returns old mode */
  286. > Is this the same 32-bit mode that the Memory control panel controls? I 
  287. > always thought that this was a different related thing. If there are 
  288. > these routines, why do we have to reboot after changing the mode in the 
  289. > Memory control panel?
  290.  
  291. SwapMMUMode () is intended for *temporary* mode changes (such as the
  292. necessary switch to 32-bit mode to access video memory on typical cards). 
  293. It does not magically change all the heaps in the machine between 24-bit
  294. form and 32-bit form (not to mention that there are now [at least] two
  295. variations of the 32-bit heap).  [So...what you can do during the temporary
  296. switch is quite limited.]
  297.  
  298. -- 
  299. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  300.    jwbaxter@pt.olympus.net
  301.  
  302. +++++++++++++++++++++++++++
  303.  
  304. >From philip@cs.wits.ac.za (Philip Machanick)
  305. Date: Wed, 25 May 1994 07:32:57 +0200
  306. Organization: Computer Science Dept, U of Witwatersrand
  307.  
  308. In article <2rodd4$99s@crl2.crl.com>, spencerl@crl.com (Spencer Low) wrote:
  309.  
  310. > Is this the same 32-bit mode that the Memory control panel controls? I 
  311. > always thought that this was a different related thing. If there are 
  312. > these routines, why do we have to reboot after changing the mode in the 
  313. > Memory control panel?
  314.  
  315. Could it be that there's a difference between locally changing the mode for
  316. a little piece of your code (e.g., check if in 32-bit mode, if so switch it
  317. off for a piece of old code then switch it on again) and globally changing
  318. it for every piece of software on the system?
  319. -- 
  320. Philip Machanick                   philip@cs.wits.ac.za
  321. Department of Computer Science, University of the Witwatersrand
  322. 2050 Wits, South Africa
  323. phone 27(11)716-3309  fax 27(11)339-7965
  324.  
  325. +++++++++++++++++++++++++++
  326.  
  327. >From shirleyd@cognos.COM (Dieter Shirley)
  328. Date: Fri, 27 May 1994 17:27:04 GMT
  329. Organization: Cognos Incorporated, Ottawa CANADA
  330.  
  331. Spencer Low (spencerl@crl.com) wrote:
  332. : Bob Boonstra (jrb@mitre.org) wrote:
  333. : > mode = GetMMUMode();  /* returns false32b (0) or true32b (1) */
  334. : > SwapMMUMode(&mode);  /* sets addressing mode and returns old mode */
  335.  
  336. : Is this the same 32-bit mode that the Memory control panel controls? I 
  337. : always thought that this was a different related thing. If there are 
  338. : these routines, why do we have to reboot after changing the mode in the 
  339. : Memory control panel?
  340.  
  341. All the traps and stuff are initialized at boot up to either work in
  342. 24-bit or 32-bit mode.  If you swap it, you can do writes to upper
  343. (video and NuBus) memory, but if you call any traps during this time,
  344. they'll expect to be in the mode that the computer started in.  If you're
  345. in a different mode, they could crash horrifically.
  346.  
  347. If you need to know if 32-bit addressing is on, use the Gestalt call.
  348. If you need 32-bit addressing on for a *short* time use SwapMMUMode().
  349. If you need 32-bit addressing on for a long time (like, the whole
  350. course of your program) inform the user to turn it on via the control
  351. panel, and then quit.  You could set the bit in PRAM yourself, but
  352. then they'd still have to restart.
  353.  
  354. Good luck,
  355. -dete
  356.  
  357. ---------------------------
  358.  
  359. >From Stephan Bublava <stephan@iguwnext.tuwien.ac.at>
  360. Subject: AppleScript Questions
  361. Date: 14 May 1994 17:45:37 GMT
  362. Organization: Vienna University of Technology
  363.  
  364. Hi, I have two questions regarding AppleScript:
  365.  
  366. 1) Is there any way to allow/disallow user interaction?
  367.  
  368. 2) Can I run a script asynchronously? I am playing around
  369.    with OSA menu and whenever I activate a script the
  370.    front application is blocked until the script is finished.
  371.    I know that "ignoring application responses" works around
  372.    this, but on the other hand, I need application responses
  373.    for some scripts to work, and to get errors back.
  374.    
  375. Any info would be appreciated.
  376.  
  377. Stephan
  378.  
  379. --
  380. Stephan Bublava
  381. stephan@iguwnext.tuwien.ac.at
  382.  
  383. +++++++++++++++++++++++++++
  384.  
  385. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  386. Date: Wed, 25 May 1994 18:38:34 GMT
  387. Organization: Apple Computer
  388.  
  389. Stephan Bublava, stephan@iguwnext.tuwien.ac.at writes:
  390. > 1) Is there any way to allow/disallow user interaction?
  391.  
  392. I seem to remember that there is, but I can't remember the syntax. Check the
  393. manual...
  394.  
  395. > 2) Can I run a script asynchronously? I am playing around
  396. >    with OSA menu and whenever I activate a script the
  397. >    front application is blocked until the script is finished.
  398. >    I know that "ignoring application responses" works around
  399. >    this, but on the other hand, I need application responses
  400. >    for some scripts to work, and to get errors back.
  401.  
  402. If you save a script as an application ("applet") it will run asynchronously
  403. in its own process. If you still want the ease-of-triggering of a menu
  404. command, you can either put the applet in the Apple menu (which will bring
  405. its layer to the front) or write a little launcher script for OSAMenu that
  406. just launches your applet.
  407.  
  408. --Jens Alfke
  409.   jens_alfke@powertalk              Rebel girl, rebel girl,
  410.             .apple.com              Rebel girl you are the queen of my world
  411.  
  412. +++++++++++++++++++++++++++
  413.  
  414. >From Stephan Bublava <stephan@iguwnext.tuwien.ac.at>
  415. Date: 27 May 1994 12:17:14 GMT
  416. Organization: Vienna University of Technology
  417.  
  418. In article <1994May25.183834.6893@gallant.apple.com> Jens Alfke,
  419. jens_alfke@powertalk.apple.com writes:
  420.  
  421. >> 1) Is there any way to allow/disallow user interaction?
  422.  
  423. >I seem to remember that there is, but I can't remember the 
  424. >syntax. Check the manual...
  425.  
  426. Well, that's what I did before posting, but it does not contain
  427. anything (I checked the manual for 1.0, and the release notes
  428. for both 1.0  and 1.1).
  429.  
  430. Thanks for your information on my other question.
  431.  
  432. In the meantime I have yet another problem: I can't get 
  433. transactions to work.
  434.  
  435. For example:
  436.  
  437. tell application "FileMaker Pro"
  438.     with transaction
  439.     ...
  440.     end transaction
  441. end tell
  442.  
  443. The problem is "end transaction" because there also is
  444. a command with the same name. If you only write "end" then
  445. it will compile, but only once because AppleScript changes
  446. the line back to "end transaction".
  447.  
  448. But apart from that, it didn't work right (with FileMaker Pro): 
  449. In the transaction I created a new record and then searched
  450. for a record that did not exist. I expected that the record I 
  451. had created would be automatically deleted again (since the 
  452. search failed), but I just got an error message.
  453.  
  454. Is this one of the many problems FileMaker has with AppleScript,
  455. or am I doing something wrong?
  456.  
  457. Stephan
  458.  
  459. --
  460. Stephan Bublava
  461. stephan@iguwnext.tuwien.ac.at
  462.  
  463. +++++++++++++++++++++++++++
  464.  
  465. >From hades@coos.dartmouth.edu (Brian V. Hughes)
  466. Date: 27 May 1994 15:52:27 GMT
  467. Organization: Dartmouth College, Hanover, NH, USA
  468.  
  469. Stephan Bublava <stephan@iguwnext.tuwien.ac.at> writes:
  470.  
  471. >In the meantime I have yet another problem: I can't get 
  472. >transactions to work.
  473.  
  474. >For example:
  475.  
  476. >tell application "FileMaker Pro"
  477. >    with transaction
  478. >    ...
  479. >    end transaction
  480. >end tell
  481.  
  482. >The problem is "end transaction" because there also is
  483. >a command with the same name. If you only write "end" then
  484. >it will compile, but only once because AppleScript changes
  485. >the line back to "end transaction".
  486.  
  487.     I think what you need to do is use the "Begin Transation" and "End
  488. Transaction" AppleScript commands that are part of FM Pro's
  489. dictionary. I don't know how they differ from the with transaction
  490. control statement but my guess is that AppleEvents were added to FM Pro
  491. before the with transaction control statement was fully implimented, and
  492. therefore it doesn't support it correctly. That's why there are separate
  493. commands for it that are FM Pro specific.
  494.  
  495. -Hades
  496.  
  497. +++++++++++++++++++++++++++
  498.  
  499. >From jonpugh@netcom.com (Jon Pugh)
  500. Date: Sun, 29 May 1994 06:36:13 GMT
  501. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  502.  
  503. Jens Alfke (jens_alfke@powertalk.apple.com) wrote:
  504. > Stephan Bublava, stephan@iguwnext.tuwien.ac.at writes:
  505. > > 1) Is there any way to allow/disallow user interaction?
  506.  
  507. > I seem to remember that there is, but I can't remember the syntax. Check the
  508. > manual...
  509.  
  510. There are no user interaction events or settings in AppleScript.  That's
  511. why programs will need to implement something similar to what I did in 
  512. PhotoFlash.  I created an application property called "user iteraction" 
  513. which takes a set of enums; none, interact with local, interact with remote, 
  514. & interact with all.  Then before you put up any dialog, call a CanDoUI
  515. routine which checks the UI level and calls AEInteractWithUser if it is not
  516. none (since the AEM doesn't include a none setting).  This ensures that you
  517. get brought to the front and/or a notification is posted.  You need to 
  518. implement none because the AEM's minimum is "interact with local" and if you
  519. run a script (via a script menu or so) your script is local and allowed to
  520. interact.  Yuck.  You need to use a global to get the never interact level 
  521. and you need to provide defaults for every function that calls CanDoUI and
  522. gets back a false.
  523.  
  524. I would suggest that a future version of AppleScript and the AEM support 
  525. this feature, if there anyone working on either.  ;)
  526.  
  527. Jon
  528.  
  529.  
  530. +++++++++++++++++++++++++++
  531.  
  532. >From jwbaxter@olympus.net (John W. Baxter)
  533. Date: Sun, 29 May 1994 08:25:58 -0700
  534. Organization: Internet for the Olympic Peninsula
  535.  
  536. In article <jonpughCqJx0D.IE3@netcom.com>, jonpugh@netcom.com (Jon Pugh)
  537. wrote:
  538.  
  539. > There are no user interaction events or settings in AppleScript.  That's
  540. > why programs will need to implement something similar to what I did in 
  541. > PhotoFlash.  I created an application property called "user iteraction" 
  542. > which takes a set of enums; none, interact with local, interact with remote, 
  543. > & interact with all.  Then before you put up any dialog, call a CanDoUI
  544. > routine which checks the UI level and calls AEInteractWithUser if it is not
  545. > none (since the AEM doesn't include a none setting).  This ensures that you
  546. > get brought to the front and/or a notification is posted.  You need to 
  547. > implement none because the AEM's minimum is "interact with local" and if you
  548. > run a script (via a script menu or so) your script is local and allowed to
  549. > interact.  Yuck.  You need to use a global to get the never interact level 
  550. > and you need to provide defaults for every function that calls CanDoUI and
  551. > gets back a false.
  552.  
  553. Jon...The AE Manager is quite happy with "never interact" as sent by the
  554. sender.  It is of course true that the client side's minimum level for
  555. AESetInteractionAllowed () is self (which I think I consider "lower" than
  556. local, since it cuts out other clients).  So you are right that to achieve
  557. never, the application has to remember that it shouldn't interact.
  558.  
  559. > I would suggest that a future version of AppleScript and the AEM support 
  560. > this feature, if there anyone working on either.  ;)
  561.  
  562. I found it surprising that AppleScript elected to use only "can" interact. 
  563. Frontier, on the other hand, can currently be set to send either "never" or
  564. "always" (version 2 was "never" or "can"...the change to "always" has
  565. caused some scripting glitches with FileMaker, which now must be brought to
  566. the front before certain actions are sent from Frontier).
  567.  
  568. So an OSA Menu script which needs to be never interact could be written in
  569. UserTalk, with the level being set to never [the UserTalk for that is
  570. setEventInteraction (false)...the setting is per-script].
  571.  
  572. I concur that AppleScript should be enhanced to permit per-script settings
  573. of "never", "can", and "always" (and control might be desired for the
  574. kAECanSwitchLayer flag, too).
  575.  
  576. Good job with your PhotoFlash workaround...I'll have to remember to
  577. implement (ie, steal) that idea.
  578. -- 
  579. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  580.    jwbaxter@pt.olympus.net
  581.  
  582. ---------------------------
  583.  
  584. >From eshieh@po.EECS.Berkeley.EDU (Eric Shieh)
  585. Subject: Code Warrior allocation of Objects
  586. Date: 22 May 1994 20:54:17 GMT
  587. Organization: University of California, Berkeley
  588.  
  589. Just received CW Gold DR/2 2 weeks ago and have ported my program
  590. from Think C 5.0 to it...seems to work great except that the CW 
  591. compiler is a lot pickier about types...anyways, that's OK.
  592.  
  593. The bulk of my program is in standard C.  Now, I'm trying to add some
  594. stuff using C++. The problem: once I allocate an object via 'new' (i haven't
  595. tryied allocating it on the stack), about 80K is allocated in the heap...
  596. Now, this may be OK in a 2-3 meg program, but since my program's total
  597. file size is 68K in a 120K partition, 80K is a big deal...
  598.  
  599. Oh, and if I call delete, the 80K remains in the heap, non-relocatable. but
  600. calling new again doesn't try to allocate another 80K....
  601.  
  602. So, my question is: Is this just the way it works or is this a bug? It seems
  603. rather odd that it's allocating so much memory since as I said, my
  604. program size is 68K, what could it be sticking in that 80K block? 
  605.  
  606. Oh, btw, is their any way to create objects as Handles instead of Pointers?
  607.  
  608. And I also recall a codewarrior mailing list around here, anyone know the
  609. address/instructions?
  610.  
  611. Thanks for listening,
  612. Eric
  613.  
  614. eshieh@cory.berkeley.edu
  615.  
  616.  
  617. +++++++++++++++++++++++++++
  618.  
  619. >From scouten@maroon.tc.umn.edu (Eric Scouten)
  620. Date: Mon, 23 May 1994 13:31:56 GMT
  621. Organization: University of Minnesota, Student Affairs
  622.  
  623. In article <2rogpp$3j1@agate.berkeley.edu>, eshieh@po.EECS.Berkeley.EDU
  624. (Eric Shieh) wrote:
  625.  
  626. > The bulk of my program is in standard C.  Now, I'm trying to add some
  627. > stuff using C++. The problem: once I allocate an object via 'new' (i haven't
  628. > tryied allocating it on the stack), about 80K is allocated in the heap...
  629.  
  630. CodeWarrior's operator new bypasses the Memory Manager when allocating
  631. small objects. It allocates its own pool of (apparently) 80K for any
  632. objects that are below a certain threshold size (4K I think?). This pool
  633. remains permanently allocated until the app quits; if it fills, CW grabs
  634. another 80K pool to create the next set of objects.
  635.  
  636. The advantage of this is that the operator new/delete pair can manage
  637. objects more efficiently (both in memory and speed) than can the Memory
  638. Manager.
  639.  
  640.  
  641. > Oh, btw, is their any way to create objects as Handles instead of Pointers?
  642.  
  643. Not in any compiler that supports multiple inheritance. (At least SC++ 7.0
  644. and CodeWarrior don't support handle objects.) Handles are an ugly way to
  645. manage objects anyway: accessing member fields is considerably less
  646. efficient, and you have to be much more careful about how you use pointers.
  647.  
  648.  
  649. > And I also recall a codewarrior mailing list around here, anyone know the
  650. > address/instructions?
  651.  
  652. Yup. To subscribe send a one line message...
  653.  
  654.    subscribe cwarrior <Your name in real life, not e-mail address>
  655.  
  656. ... to the address listserv@netcom.com. Make sure your signature is turned
  657. off.
  658.  
  659. -Eric
  660.  
  661.  
  662. -- 
  663. Eric Scouten  *  Univ of Minnesota  *  Student Affairs  *  +1 612 626 0746
  664.   ** MS Computer Science student, Univ of Illinois, starting Aug '94 **
  665.  
  666. WYSIWIG: What You See Is What You Get
  667.  
  668. WYSIWOBBLE: What You See Isn't What's Output By the Blasted Laserwriter Eh?
  669.  
  670. +++++++++++++++++++++++++++
  671.  
  672. >From partingt@fwi.uva.nl (Vincent Partington)
  673. Date: 24 May 1994 11:58:59 GMT
  674. Organization: FWI, University of Amsterdam
  675.  
  676. eshieh@po.EECS.Berkeley.EDU (Eric Shieh) writes:
  677.  
  678. >The bulk of my program is in standard C.  Now, I'm trying to add some
  679. >stuff using C++. The problem: once I allocate an object via 'new' (i haven't
  680. >tryied allocating it on the stack), about 80K is allocated in the heap...
  681. >Now, this may be OK in a 2-3 meg program, but since my program's total
  682. >file size is 68K in a 120K partition, 80K is a big deal...
  683.  
  684. This is because new and delete use their own allocator system that gets
  685. chunks of OS-memory at once to efficiently manage memory.
  686. You can bypass this be recompiling the C++ Runtime library: the source-
  687. code for new/delete is in the C++ Runtime directory, there's a define that
  688. you can change to make new/delete use NewPtr/DisposePtr, just have
  689. a look at the code in the New.cp and NewMore.cp files.
  690.  
  691. Vincent.
  692. -- 
  693. My opinions are not my own. I copy them    | Internet : partingt@fwi.uva.nl
  694. from books, television, video, the net,    |            vincent@tnc.nl
  695. my friends, my parents, my teachers and    | FidoNet  : 2:281/202.15
  696. and numerous other contributors.           | NeST     : 90:500/202.15
  697.  
  698. +++++++++++++++++++++++++++
  699.  
  700. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  701. Date: Wed, 25 May 1994 19:15:42 GMT
  702. Organization: Apple Computer
  703.  
  704. In article <2rsq63$h0k@hermes.fwi.uva.nl> Vincent Partington,
  705. partingt@fwi.uva.nl writes:
  706. > This is because new and delete use their own allocator system that gets
  707. > chunks of OS-memory at once to efficiently manage memory.
  708. > You can bypass this be recompiling the C++ Runtime library...
  709.  
  710. Naw, just add an 'operator new' and 'operator delete' in the base class and
  711. have it use some other allocation scheme. NewPtr will work okay but will be
  712. lots slower if tons of objects are being created and deleted. If the program
  713. is already using some more efficient memory allocator (malloc or something)
  714. then you can use that.
  715.  
  716. --Jens Alfke
  717.   jens_alfke@powertalk              Rebel girl, rebel girl,
  718.             .apple.com              Rebel girl you are the queen of my world
  719.  
  720. +++++++++++++++++++++++++++
  721.  
  722. >From partingt@fwi.uva.nl (Vincent Partington)
  723. Date: 26 May 1994 10:47:10 GMT
  724. Organization: FWI, University of Amsterdam
  725.  
  726. Jens Alfke <jens_alfke@powertalk.apple.com> writes:
  727.  
  728. >> This is because new and delete use their own allocator system that gets
  729. >> chunks of OS-memory at once to efficiently manage memory.
  730. >> You can bypass this be recompiling the C++ Runtime library...
  731.  
  732. >Naw, just add an 'operator new' and 'operator delete' in the base class and
  733. >have it use some other allocation scheme. NewPtr will work okay but will be
  734. >lots slower if tons of objects are being created and deleted. If the program
  735. >is already using some more efficient memory allocator (malloc or something)
  736. >then you can use that.
  737.  
  738. When adding those operators to "the" base class you have to change your C++
  739. code and derive all your classes from that class. Changing the C++ Runtime lib
  740. is admittedly dirtier but doesn't require changing the C++ code.
  741. Changing the C++ Runtime lib also allows you to change the allocation routines
  742. for arrays becuase AFAIK you can't change operator new/delete for arrays.
  743.  
  744. Vincent\n
  745. -- 
  746. My opinions are not my own. I copy them    | Internet : partingt@fwi.uva.nl
  747. from books, television, video, the net,    |            vincent@tnc.nl
  748. my friends, my parents, my teachers and    | FidoNet  : 2:281/202.15
  749. and numerous other contributors.           | NeST     : 90:500/202.15
  750.  
  751. +++++++++++++++++++++++++++
  752.  
  753. >From Jens Alfke <jens_alfke@powertalk.apple.com>
  754. Date: Fri, 27 May 1994 20:04:20 GMT
  755. Organization: Apple Computer
  756.  
  757. Vincent Partington, partingt@fwi.uva.nl writes:
  758. > When adding those operators to "the" base class you have to change your C++
  759. > code and derive all your classes from that class. Changing the C++ Runtime
  760. lib
  761. > is admittedly dirtier but doesn't require changing the C++ code.
  762.  
  763. That's a fair point; but you can always just define your own global operator
  764. new and operator delete, and then include the C++ runtime library without its
  765. operator new support. (I think there is a version of the library without
  766. operator new in it.) All of your classes will use the global operator
  767. new/delete by default.
  768.  
  769. I'm always leery of modifying system libraries, since they generally change
  770. in every release and then I have to redo my work all over again.
  771.  
  772. --Jens Alfke
  773.   jens_alfke@powertalk              Rebel girl, rebel girl,
  774.             .apple.com              Rebel girl you are the queen of my world
  775.  
  776. ---------------------------
  777.  
  778. >From amanda@intercon.com (Amanda Walker)
  779. Subject: Code Warrior: ruminations of a long-time MPW user
  780. Date: Tue, 24 May 1994 11:47:08 -0500
  781. Organization: InterCon Systems Corporation, Herndon, VA USA
  782.  
  783. Several people have expressed surprise at my couple of posts supporting Code 
  784. Warrior yesterday, since I've been a die-hard MPW user for years.  I thought
  785. I'd go into some more detail on this, since the issues involved are not unique 
  786. to me alone.
  787.  
  788. I've been using MPW since version 2.  I've also used just about every other C 
  789. compiler to come out for the Mac, from the Megamax C and Consulair C to THINK 
  790. C 7.0.  All of these systems have their good points and their bad points.  
  791. However, for multi-project multi-person development, MPW has held the lead.  
  792. It is no speed demon in terms of lines per minute compiled, but it is 
  793. extremely flexible.  The abilities to script the environment, provide multi-
  794. user source code and revision control, and add custom tools serve to make up 
  795. in the long term for a lack of compilation speed.  Also, Apple generally 
  796. releases new technology via MPW header files and/or libraries, which can be 
  797. especially important when dealing with pre-release versions of Apple software 
  798. (as I have been a number of times).  All of these things have kept me in the 
  799. MPW camp for the kind of work I do most.  Symantec C 6.0 looked promising, 
  800. since it was finally scriptable, but the bugs in it and the general manner in 
  801. which Symantec has handled 6.x and 7.0 have undermined my faith in their 
  802. ability to deliver a quality product, despite having used it off and on since 
  803. it was called "Lightspeed C".
  804.  
  805. I'd seen a preview of Code Warrior in December at one of Apple's "PowerPC 
  806. Coding Kitchens" which they ran for developers in the seeding program.  It 
  807. looked promising, but it was still kind of buggy, and was not scriptable.  The 
  808. person doing the demo characterized it as analogous to THINK C 5.x for the 
  809. PowerPC.  As a result, I sighed and went back to the Apple RISC SDK, which I 
  810. fought with for some time before finally getting a build that I felt 
  811. comfortable saying we could ship to customers.  However, by this time I was 
  812. getting aggravated at MPW as well.  The PowerPC C compilers and linker in 
  813. Apple's SDK are excruciatingly slow, and the optimizer breaks.  TCP/Connect II 
  814. 1.2.1 is built with optimization off to avoid compiler bus errors and bad code 
  815. generation.  It also doesn't run native, making the 8100/80 on my desk almost
  816. usefuless for anything but testing.
  817.  
  818. It has not been a fun spring in some respects.
  819.  
  820. By the WWDC, Code Warrior had started to get rave reviews, both here and from 
  821. other developers whose opinions I have learned to respect, so I went with an 
  822. open mind.  After watching the Metrowerks presentation, and sitting down with 
  823. Code Warrior myself, I became convinced that they really did know what they 
  824. were doing.  It was fast, native, and had an optimizer that seems to actually
  825. work.  It's scriptable, so that I can do a large multi-project build without 
  826. having to hand-drive the process.  It coexists nicely with SourceServer, so 
  827. that I can continue to use existing source code databases.  It's code 
  828. generator isn't a mangled version of an 8x86 code generator, so it actually 
  829. generates nice code.  I don't have to hook my PowerBook up to my Power Mac 
  830. just to run the debugger.  It's not perfect, but it finally tipped the scale 
  831. compared to MPW.  MPW tool versions of the compilers and linkers, which 
  832. Metrowerks says are in the pipeline, will be the final clincher, since they 
  833. will give me the best of both worlds.
  834.  
  835. Besides, Metrowerks seems to be as much a bunch of crazy workaholics as
  836. InterCon is :).
  837.  
  838.  
  839. Amanda Walker
  840. Advanced Projects
  841. InterCon Systems Corporation
  842.  
  843.  
  844.  
  845. +++++++++++++++++++++++++++
  846.  
  847. >From mikel@intercon.com (Michael W. Wellman)
  848. Date: Tue, 24 May 1994 14:30:57 -0500
  849. Organization: InterCon Systems Corp., Herndon, VA, USA
  850.  
  851. amanda@intercon.com (Amanda Walker) writes:
  852. > However, by this time I was getting aggravated at MPW as well.  
  853. > The PowerPC C compilers and linker in Apple's SDK are excruciatingly 
  854. > slow, and the optimizer breaks.  TCP/Connect II 1.2.1 is built with 
  855. > optimization off to avoid compiler bus errors and bad code generation.  
  856. > It also doesn't run native, making the 8100/80 on my desk almost 
  857. > usefuless for anything but testing. 
  858.  
  859. Er, I'd just like to make it clear that the "It" above refers to MPW and not 
  860. TCP/Connect II 1.2.1.  The latter works quite nicely natively...
  861.  
  862. Now if only Metrowerks and Apple's Open Transport would work out their 
  863. differences regards Apple's Shared Library Manager.
  864.  
  865. mikel
  866.  
  867.  
  868.  
  869.  
  870.  
  871. +++++++++++++++++++++++++++
  872.  
  873. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  874. Date: Tue, 24 May 94 14:30:05 PST
  875. Organization: Peirce Software, Inc.
  876.  
  877.  
  878. In article <9405241430.AA57204@mikel.intercon.com> (comp.sys.mac.programmer), mikel@intercon.com (Michael W. Wellman) writes:
  879. > amanda@intercon.com (Amanda Walker) writes:
  880. > > However, by this time I was getting aggravated at MPW as well.  
  881. > > The PowerPC C compilers and linker in Apple's SDK are excruciatingly 
  882. > > slow, and the optimizer breaks.  TCP/Connect II 1.2.1 is built with 
  883. > > optimization off to avoid compiler bus errors and bad code generation.  
  884. > > It also doesn't run native, making the 8100/80 on my desk almost 
  885. > > usefuless for anything but testing. 
  886. > Er, I'd just like to make it clear that the "It" above refers to MPW and not 
  887. > TCP/Connect II 1.2.1.  The latter works quite nicely natively...
  888.  
  889. The "prerelease MPW" version 3.4a2 from E.T.O. 14 has some native
  890. parts in it now.
  891.  
  892. The shell is native, as is make, rez, derez, and rezdet.  Too bad
  893. Link and C aren't native, but the native shell (and my faster hard
  894. disk) make for a quicker startup.  And the Make doesn't take any time
  895. anymore either.
  896.  
  897. It's only a start, but at least its better than nothing.
  898.  
  899. (I'm very much looking forward to trying the CodeWarrior compiler
  900. and linker under MPW!)
  901.  
  902. __ Michael Peirce        __ peirce@outpost.sf-bay.org
  903. __ Peirce Software, Inc. __ 719 Hibiscus Place, Suite 301
  904. __                       __ San Jose, California USA 95117-1844
  905. __ Makers of: Smoothie & __ voice: +1.408.244.6554 fax: +1.408.244.6882
  906. __    Peirce Print Tools __ AppleLink: peirce & AOL: AFC Peirce
  907.  
  908. +++++++++++++++++++++++++++
  909.  
  910. >From songer@ovation.lexmark.com (Christopher Songer)
  911. Date: Wed, 25 May 1994 13:50:40 GMT
  912. Organization: Lexmark International, Lexington, KY
  913.  
  914. In article <9405241147.AA08906@fusion.intercon.com> amanda@intercon.com (Amanda Walker) writes:
  915.  
  916.    [...]
  917.    By the WWDC, Code Warrior had started to get rave reviews, both here and from 
  918.    other developers whose opinions I have learned to respect, so I went with an 
  919.    open mind.  
  920.    [...]
  921.  
  922. Hi!
  923.  
  924.      Thanks for the review -- it is much appreciated and was quite
  925. informative. Can you speak to the source control management provided
  926. by the CodeWarrior package? 
  927.  
  928. Thanks!
  929. -Chris
  930. songer@lexmark.com
  931.  
  932. +++++++++++++++++++++++++++
  933.  
  934. >From amanda@intercon.com (Amanda Walker)
  935. Date: Wed, 25 May 1994 17:35:41 -0400
  936. Organization: InterCon Systems Corporation, Herndon, VA USA
  937.  
  938. mikel@intercon.com (Michael W. Wellman) writes:
  939. > Er, I'd just like to make it clear that the "It" above refers to MPW 
  940. > and not TCP/Connect II 1.2.1.  The latter works quite nicely natively... 
  941.  
  942. Yes, indeed.  I used it to post that article, in fact :).
  943.  
  944.  
  945. Amanda Walker
  946. InterCon Systems Corporation
  947.  
  948.  
  949.  
  950. +++++++++++++++++++++++++++
  951.  
  952. >From jpurlia@qualcomm.com (John Purlia)
  953. Date: Thu, 26 May 1994 13:17:22 -0800
  954. Organization: Qualcomm, Inc.
  955.  
  956. In article <9405241147.AA08906@fusion.intercon.com> amanda@intercon.com
  957. (Amanda Walker) writes:
  958. >[...]
  959. >By the WWDC, Code Warrior had started to get rave reviews, both here and from 
  960. >other developers whose opinions I have learned to respect, so I went with an 
  961. >open mind.  
  962. >[...]
  963.  
  964. Yes, a very large number of Apple engineers are using and raving about Code
  965. Warrior which is encouraging when evaluating the stability and usefulness
  966. of a new development environment.  I'd very much prefer to use the power
  967. available to me through the MPW environment so I'm eagerly awaiting the
  968. release of native MPW tools from MetroWerks -- especially after talking to
  969. a couple of people at the MPW station at the conference expo who
  970. regrettably informed me that there are no plans for porting a 68K compiler
  971. to run native on PPC, which means... writing fat binaries will require you
  972. to compile the 68K portion of your app with an emulated compiler!  AARGH!!!
  973. ...........................................................................
  974. John Purlia          : My brain; not my company's brain.  My brain says...
  975. jpurlia@qualcomm.com :
  976. Applelink    AM0470  :   "Newton could never live on Via de la Valle,
  977. NewtonMail:  JPurlia :  but it would be right at home on Cruel Lucille"
  978.  
  979. +++++++++++++++++++++++++++
  980.  
  981. >From amanda@intercon.com (Amanda Walker)
  982. Date: Fri, 27 May 1994 12:27:38 -0500
  983. Organization: InterCon Systems Corporation, Herndon, VA USA
  984.  
  985. songer@ovation.lexmark.com (Christopher Songer) writes:
  986. > Thanks for the review -- it is much appreciated and was quite 
  987. > informative. Can you speak to the source control management provided 
  988. > by the CodeWarrior package? 
  989.  
  990. Currently, it is Projector-aware, so we're continuing to use SourceServer from 
  991. MPW.  Code Warrior does not have its own source code control system.
  992.  
  993.  
  994. Amanda Walker
  995. InterCon Systems Corporation
  996.  
  997.  
  998.  
  999. ---------------------------
  1000.  
  1001. >From nathan@cse.ucsc.edu (Nathan J. Wilson)
  1002. Subject: Refinement of SC++ 7.0 code gen bug
  1003. Date: 27 May 1994 06:34:38 GMT
  1004. Organization: UC Santa Cruz CIS/CE
  1005.  
  1006. First, I must say that I have been pleased with the response to my
  1007. original posting (Thanks Tom and Phil!).  I managed to reduce the
  1008. bug to a small stand alone example.  I have already send this to
  1009. Symantec directly, but I thought I should post it here so other's
  1010. could know what to watch out for until a fix is available.  The
  1011. causes appears to be with assign in the results of virtual
  1012. member function that returns a double directly to a member of
  1013. another class (or struct) within a loop.  The effect is that some
  1014. unpreserved registers get trashed resulting in garbage.  Work around
  1015. is to assign the result to a temporary.
  1016.  
  1017. -Nathan
  1018.  
  1019. // main.cpp
  1020.  
  1021. // Demonstration of a code generation bug in Symantec C++ 7.0
  1022. // Output should be:
  1023. // 12.34 == <garbage float>
  1024. //
  1025. // If you set BUG to 0 then you get the correct output which should be
  1026. // 12.34 == 12.34
  1027. //
  1028.  
  1029. #define BUG 1
  1030.  
  1031. #include <stdio.h>
  1032.  
  1033. #define THE_TYPE double // Must be double, float works fine
  1034.  
  1035. class FeatureNum {
  1036. public:
  1037.   THE_TYPE num; // Destination must be a member of a class or struct
  1038. };
  1039.  
  1040. class Foo {
  1041. public:
  1042.   virtual THE_TYPE Eval() { return 12.34; }; // Function must be a virtual member function
  1043. };
  1044.  
  1045. int main()
  1046. {
  1047.   Foo *foo = new Foo(); // Must be pointer to an object.  Can't use Foo foo;
  1048.   FeatureNum table2[1];
  1049.   long i = 0;
  1050.   while (i < 1) { // Must have loop
  1051. #if BUG
  1052.       table2[i].num = foo->Eval(); // Obviously, assignment must be direct
  1053. #else
  1054.       THE_TYPE tmp = foo->Eval();
  1055.       table2[i].num = tmp;
  1056. #endif
  1057.       printf("%lg == %lg\n", foo->Eval(), table2[i].num);
  1058.       i++;
  1059.   }
  1060.   delete foo;
  1061.   return 0;
  1062. }
  1063.  
  1064. #ifdef NEVER
  1065.  
  1066. Here is the disassembled buggy code:
  1067.  
  1068. main:
  1069. 00000000: 4E56 FFDC          LINK      A6,#$FFDC
  1070. 00000004: 48E7 1838          MOVEM.L   D3/D4/A2-A4,-(A7)
  1071. 00000008: 7004               MOVEQ     #$04,D0
  1072. 0000000A: 2F00               MOVE.L    D0,-(A7)
  1073. 0000000C: 4EBA 0000          JSR       operator new(unsigned int)
  1074. 00000010: 2840               MOVEA.L   D0,A4
  1075. 00000012: 4A80               TST.L     D0
  1076. 00000014: 670C               BEQ.S     *+$000E        ; 00000022
  1077. 00000016: 2D40 FFE8          MOVE.L    D0,$FFE8(A6)
  1078. 0000001A: 41ED 0000          LEA       Foo::_vtbl,A0
  1079. 0000001E: 2240               MOVEA.L   D0,A1
  1080. 00000020: 2288               MOVE.L    A0,(A1)
  1081. 00000022: 200C               MOVE.L    A4,D0
  1082. 00000024: 2640               MOVEA.L   D0,A3
  1083. 00000026: 7000               MOVEQ     #$00,D0
  1084. 00000028: 2800               MOVE.L    D0,D4
  1085. 0000002A: 0C84 0000 0001     CMPI.L    #$00000001,D4
  1086. 00000030: 6C00 0096          BGE       *+$0098        ; 000000C8
  1087. 00000034: 2F0B               MOVE.L    A3,-(A7)
  1088. 00000036: 204B               MOVEA.L   A3,A0
  1089. 00000038: 2250               MOVEA.L   (A0),A1
  1090. 0000003A: 2251               MOVEA.L   (A1),A1
  1091. 0000003C: 4E91               JSR       (A1)
  1092. 0000003E: 2604               MOVE.L    D4,D3
  1093. 00000040: 2003               MOVE.L    D3,D0
  1094. 00000042: C6FC 000A          MULU.W    #$000A,D3
  1095. 00000046: 4840               SWAP      D0
  1096. 00000048: C0FC 000A          MULU.W    #$000A,D0
  1097. 0000004C: 4840               SWAP      D0
  1098. 0000004E: 4240               CLR.W     D0
  1099. 00000050: D680               ADD.L     D0,D3
  1100. 00000052: 45EE FFDC          LEA       $FFDC(A6),A2
  1101. 00000056: 3580 3000          MOVE.W    D0,$00(A2,D3.W)
  1102. 0000005A: 2581 3002          MOVE.L    D1,$02(A2,D3.W)
  1103. 0000005E: 2588 3006          MOVE.L    A0,$06(A2,D3.W)
  1104. 00000062: 2004               MOVE.L    D4,D0
  1105. 00000064: 2200               MOVE.L    D0,D1
  1106. 00000066: C0FC 000A          MULU.W    #$000A,D0
  1107. 0000006A: 4841               SWAP      D1
  1108. 0000006C: C2FC 000A          MULU.W    #$000A,D1
  1109. 00000070: 4841               SWAP      D1
  1110. 00000072: 4241               CLR.W     D1
  1111. 00000074: D081               ADD.L     D1,D0
  1112. 00000076: 2D72 0000 FFF6     MOVE.L    $00(A2,D0.W),$FFF6(A6)
  1113. 0000007C: 2D72 0004 FFFA     MOVE.L    $04(A2,D0.W),$FFFA(A6)
  1114. 00000082: 3D72 0008 FFFE     MOVE.W    $08(A2,D0.W),$FFFE(A6)
  1115. 00000088: 2F2E FFFC          MOVE.L    $FFFC(A6),-(A7)
  1116. 0000008C: 2F2E FFF8          MOVE.L    $FFF8(A6),-(A7)
  1117. 00000090: 3F2E FFF6          MOVE.W    $FFF6(A6),-(A7)
  1118. 00000094: 2F0B               MOVE.L    A3,-(A7)
  1119. 00000096: 204B               MOVEA.L   A3,A0
  1120. 00000098: 2050               MOVEA.L   (A0),A0
  1121. 0000009A: 2050               MOVEA.L   (A0),A0
  1122. 0000009C: 4E90               JSR       (A0)
  1123. 0000009E: 3D40 FFEC          MOVE.W    D0,$FFEC(A6)
  1124. 000000A2: 2D41 FFEE          MOVE.L    D1,$FFEE(A6)
  1125. 000000A6: 2D48 FFF2          MOVE.L    A0,$FFF2(A6)
  1126. 000000AA: 2F2E FFF2          MOVE.L    $FFF2(A6),-(A7)
  1127. 000000AE: 2F2E FFEE          MOVE.L    $FFEE(A6),-(A7)
  1128. 000000B2: 3F2E FFEC          MOVE.W    $FFEC(A6),-(A7)
  1129. 000000B6: 486D 0000          PEA       $0000(A5)
  1130. 000000BA: 4EBA 0000          JSR       printf
  1131. 000000BE: 4FEF 0018          LEA       $0018(A7),A7
  1132. 000000C2: 5284               ADDQ.L    #$1,D4
  1133. 000000C4: 6000 FF64          BRA       *-$009A        ; 0000002A
  1134. 000000C8: 2F0B               MOVE.L    A3,-(A7)
  1135. 000000CA: 4EBA 0000          JSR       operator delete(void *)
  1136. 000000CE: 7000               MOVEQ     #$00,D0
  1137. 000000D0: 4CDF 1C18          MOVEM.L   (A7)+,D3/D4/A2-A4
  1138. 000000D4: 4E5E               UNLK      A6
  1139. 000000D6: 4E75               RTS
  1140. 000000D8
  1141.  
  1142. Foo::Eval(void):
  1143. 00000000: 4E56 FFF4          LINK      A6,#$FFF4
  1144. 00000004: 2D7C 4002 C570     MOVE.L    #$4002C570,$FFF6(A6)
  1145.           FFF6           
  1146. 0000000C: 2D7C A3D7 0A3D     MOVE.L    #$A3D70A3D,$FFFA(A6)
  1147.           FFFA           
  1148. 00000014: 3D7C 7000 FFFE     MOVE.W    #$7000,$FFFE(A6)
  1149. 0000001A: 302E FFF6          MOVE.W    $FFF6(A6),D0
  1150. 0000001E: 222E FFF8          MOVE.L    $FFF8(A6),D1
  1151. 00000022: 206E FFFC          MOVEA.L   $FFFC(A6),A0
  1152. 00000026: 4E5E               UNLK      A6
  1153. 00000028: 225F               MOVEA.L   (A7)+,A1
  1154. 0000002A: 584F               ADDQ.W    #$4,A7
  1155. 0000002C: 4ED1               JMP       (A1)
  1156. 0000002E
  1157.  
  1158. Here is the disassembled non-buggy code.  Changes are commented:
  1159.  
  1160. main:
  1161. 00000000: 4E56 FFD0          LINK      A6,#$FFD0
  1162. 00000004: 48E7 1838          MOVEM.L   D3/D4/A2-A4,-(A7)
  1163. 00000008: 7004               MOVEQ     #$04,D0
  1164. 0000000A: 2F00               MOVE.L    D0,-(A7)
  1165. 0000000C: 4EBA 0000          JSR       operator new(unsigned int)
  1166. 00000010: 2840               MOVEA.L   D0,A4
  1167. 00000012: 4A80               TST.L     D0
  1168. 00000014: 670C               BEQ.S     *+$000E        ; 00000022
  1169. 00000016: 2D40 FFE8          MOVE.L    D0,$FFE8(A6)
  1170. 0000001A: 41ED 0000          LEA       Foo::_vtbl,A0
  1171. 0000001E: 2240               MOVEA.L   D0,A1
  1172. 00000020: 2288               MOVE.L    A0,(A1)
  1173. 00000022: 200C               MOVE.L    A4,D0
  1174. 00000024: 2640               MOVEA.L   D0,A3
  1175. 00000026: 7000               MOVEQ     #$00,D0
  1176. 00000028: 2800               MOVE.L    D0,D4
  1177. 0000002A: 0C84 0000 0001     CMPI.L    #$00000001,D4
  1178. 00000030: 6C00 00A8          BGE       *+$00AA        ; 000000DA
  1179. 00000034: 2F0B               MOVE.L    A3,-(A7)
  1180. 00000036: 204B               MOVEA.L   A3,A0
  1181. 00000038: 2250               MOVEA.L   (A0),A1
  1182. 0000003A: 2251               MOVEA.L   (A1),A1
  1183. 0000003C: 4E91               JSR       (A1)
  1184. 0000003E: 3D40 FFDC          MOVE.W    D0,$FFDC(A6) ; Added
  1185. 00000042: 2D41 FFDE          MOVE.L    D1,$FFDE(A6) ; Added
  1186. 00000046: 2D48 FFE2          MOVE.L    A0,$FFE2(A6) ; Added
  1187. 0000004A: 2604               MOVE.L    D4,D3
  1188. 0000004C: 2003               MOVE.L    D3,D0
  1189. 0000004E: C6FC 000A          MULU.W    #$000A,D3
  1190. 00000052: 4840               SWAP      D0
  1191. 00000054: C0FC 000A          MULU.W    #$000A,D0
  1192. 00000058: 4840               SWAP      D0
  1193. 0000005A: 4240               CLR.W     D0
  1194. 0000005C: D680               ADD.L     D0,D3
  1195. 0000005E: 45EE FFD0          LEA       $FFD0(A6),A2
  1196. 00000062: 25AE FFDC 3000     MOVE.L    $FFDC(A6),$00(A2,D3.W) ; Change
  1197. 00000068: 25AE FFE0 3004     MOVE.L    $FFE0(A6),$04(A2,D3.W) ; Change
  1198. 0000006E: 35AE FFE4 3008     MOVE.W    $FFE4(A6),$08(A2,D3.W) ; Change
  1199. 00000074: 2004               MOVE.L    D4,D0
  1200. 00000076: 2200               MOVE.L    D0,D1
  1201. 00000078: C0FC 000A          MULU.W    #$000A,D0
  1202. 0000007C: 4841               SWAP      D1
  1203. 0000007E: C2FC 000A          MULU.W    #$000A,D1
  1204. 00000082: 4841               SWAP      D1
  1205. 00000084: 4241               CLR.W     D1
  1206. 00000086: D081               ADD.L     D1,D0
  1207. 00000088: 2D72 0000 FFF6     MOVE.L    $00(A2,D0.W),$FFF6(A6)
  1208. 0000008E: 2D72 0004 FFFA     MOVE.L    $04(A2,D0.W),$FFFA(A6)
  1209. 00000094: 3D72 0008 FFFE     MOVE.W    $08(A2,D0.W),$FFFE(A6)
  1210. 0000009A: 2F2E FFFC          MOVE.L    $FFFC(A6),-(A7)
  1211. 0000009E: 2F2E FFF8          MOVE.L    $FFF8(A6),-(A7)
  1212. 000000A2: 3F2E FFF6          MOVE.W    $FFF6(A6),-(A7)
  1213. 000000A6: 2F0B               MOVE.L    A3,-(A7)
  1214. 000000A8: 204B               MOVEA.L   A3,A0
  1215. 000000AA: 2050               MOVEA.L   (A0),A0
  1216. 000000AC: 2050               MOVEA.L   (A0),A0
  1217. 000000AE: 4E90               JSR       (A0)
  1218. 000000B0: 3D40 FFEC          MOVE.W    D0,$FFEC(A6)
  1219. 000000B4: 2D41 FFEE          MOVE.L    D1,$FFEE(A6)
  1220. 000000B8: 2D48 FFF2          MOVE.L    A0,$FFF2(A6)
  1221. 000000BC: 2F2E FFF2          MOVE.L    $FFF2(A6),-(A7)
  1222. 000000C0: 2F2E FFEE          MOVE.L    $FFEE(A6),-(A7)
  1223. 000000C4: 3F2E FFEC          MOVE.W    $FFEC(A6),-(A7)
  1224. 000000C8: 486D 0000          PEA       $0000(A5)
  1225. 000000CC: 4EBA 0000          JSR       printf
  1226. 000000D0: 4FEF 0018          LEA       $0018(A7),A7
  1227. 000000D4: 5284               ADDQ.L    #$1,D4
  1228. 000000D6: 6000 FF52          BRA       *-$00AC        ; 0000002A
  1229. 000000DA: 2F0B               MOVE.L    A3,-(A7)
  1230. 000000DC: 4EBA 0000          JSR       operator delete(void *)
  1231. 000000E0: 7000               MOVEQ     #$00,D0
  1232. 000000E2: 4CDF 1C18          MOVEM.L   (A7)+,D3/D4/A2-A4
  1233. 000000E6: 4E5E               UNLK      A6
  1234. 000000E8: 4E75               RTS
  1235. 000000EA
  1236.  
  1237. Foo::Eval(void):
  1238. 00000000: 4E56 FFF4          LINK      A6,#$FFF4
  1239. 00000004: 2D7C 4002 C570     MOVE.L    #$4002C570,$FFF6(A6)
  1240.           FFF6           
  1241. 0000000C: 2D7C A3D7 0A3D     MOVE.L    #$A3D70A3D,$FFFA(A6)
  1242.           FFFA           
  1243. 00000014: 3D7C 7000 FFFE     MOVE.W    #$7000,$FFFE(A6)
  1244. 0000001A: 302E FFF6          MOVE.W    $FFF6(A6),D0
  1245. 0000001E: 222E FFF8          MOVE.L    $FFF8(A6),D1
  1246. 00000022: 206E FFFC          MOVEA.L   $FFFC(A6),A0
  1247. 00000026: 4E5E               UNLK      A6
  1248. 00000028: 225F               MOVEA.L   (A7)+,A1
  1249. 0000002A: 584F               ADDQ.W    #$4,A7
  1250. 0000002C: 4ED1               JMP       (A1)
  1251. 0000002E
  1252.  
  1253. Finally, here is a text version of the project file used to compile the code:
  1254. Wombat:Apps:ThinkC/C++:Play:Play.9
  1255. 1 segments
  1256. 3 files
  1257.  
  1258. Segment 3
  1259. Name: 
  1260. Preload: false
  1261. Protected: true
  1262. Locked: true
  1263. Purgeable: true
  1264. SystemHeap: false
  1265. 3 files:
  1266. Wombat:Apps:ThinkC/C++:SC++7.0:Standard Libraries:ANSI++
  1267. Wombat:Apps:ThinkC/C++:SC++7.0:Standard Libraries:CPlusLib
  1268. Wombat:Apps:ThinkC/C++:Play:main.cpp
  1269.  
  1270. #endif
  1271.  
  1272.  
  1273. ---------------------------
  1274.  
  1275. >From fever@winternet.com (Fever)
  1276. Subject: Serial Port Programming?
  1277. Date: 26 May 1994 20:45:00 GMT
  1278. Organization: StarNet Communications, Inc
  1279.  
  1280. Could someone direct me to where I can find information on programming the
  1281. Mac's serial ports?  (Specifically: For modems, in C)
  1282.  
  1283. I'd appreciate any information...
  1284.  
  1285.  
  1286.  
  1287. +++++++++++++++++++++++++++
  1288.  
  1289. >From d88-jwa@dront.nada.kth.se (Jon Wdtte)
  1290. Date: 27 May 1994 06:48:46 GMT
  1291. Organization: The Royal Institute of Technology
  1292.  
  1293. In <2s31oc$16d@blackice.winternet.com> fever@winternet.com (Fever) writes:
  1294.  
  1295. >Could someone direct me to where I can find information on programming the
  1296. >Mac's serial ports?  (Specifically: For modems, in C)
  1297.  
  1298. The comp.sys.mac.programmer FAQ answer sheet shows, in code, how
  1299. to make a list of all available serial ports, and then go on to
  1300. use it for something. You can also check Think Reference 2.0.
  1301.  
  1302. nada.kth.se:pub/hacks/mac-faq
  1303.  
  1304. Cheers,
  1305.  
  1306.                     / h+
  1307.  
  1308. -- 
  1309.  -- Jon W{tte, h+@nada.kth.se, Mac Software Engineer Deluxe --
  1310.   "After I first used the Mac, I had a dream in which I would walk up to
  1311.    people, touch them, and they'd turn black. Then I could talk to them."
  1312.                      -- Anon
  1313.  
  1314. +++++++++++++++++++++++++++
  1315.  
  1316. >From egurney@vcd.hp.com (Eddy J. Gurney)
  1317. Date: Sat, 28 May 1994 00:49:06 GMT
  1318. Organization: Hewlett-Packard VCD
  1319.  
  1320. Fever (fever@winternet.com) wrote:
  1321. >Could someone direct me to where I can find information on programming the
  1322. >Mac's serial ports?  (Specifically: For modems, in C)
  1323.  
  1324. Check out the sample code on ftp.apple.com in:
  1325.  
  1326. /dts/mac/sc/snippets/devices/pbxxx-serial-demo.hqx
  1327.  
  1328. It is a good example of using the Mac serial ports "correctly".
  1329.  
  1330. --
  1331. Eddy J. Gurney N8FPW   Hewlett-Packard Company, Vancouver (USA!) Division
  1332. egurney@vcd.hp.com                       #include <standard-disclaimer.h>
  1333. "Failures are divided into two classes-- those who thought and never did,
  1334.       and those who did and never thought."     John Charles Salak
  1335.  
  1336. ---------------------------
  1337.  
  1338. >From sfkaplan@alife.santafe.edu (Scott Kaplan)
  1339. Subject: Serial port use
  1340. Date: 24 May 1994 19:59:57 GMT
  1341. Organization: The Santa Fe Institute
  1342.  
  1343. Hi there.   I'm writing a quick little program which needs to make use of the
  1344. serial ports (specifically, the modem port attached to, of all things, a
  1345. modem...).  
  1346. For what this program is doing, it does not seem worth my time to figure out
  1347. how to use the Comm Toolbox, so I thought I'd do it directly by opening the
  1348. serial drivers and using good ol' FSRead and FSWrite.  I'm having trouble,
  1349. and I was hoping someone could tell me why.
  1350.  
  1351. Here's the problem.  I've go to do an FSRead on the modem port.  If there is
  1352. something waiting in the modem port's buffer, everything's great.  However,
  1353. if there is nothing there (nothing has come in since I read from it last),
  1354. I die.  Rather than returning a count of 0 bytes read in, and rather than
  1355. returning some error value from FSRead, the machine crashes completely.  I
  1356. have to reboot.  So, I am clearly doing something wrong here...
  1357.  
  1358. If someone knows what this might be, please let me know.  If more information
  1359. about what I'm doing is needed, please ask, I'll be happy to provide it.  and
  1360. if you think that I shouldn't be avoiding the Comm Toolbox and that it would
  1361. easily solve my problems, let me know about that too.
  1362.  
  1363. Thanks muchly.
  1364.  
  1365. Scott Kaplan
  1366.  
  1367.  
  1368. +++++++++++++++++++++++++++
  1369.  
  1370. >From egurney@vcd.hp.com (Eddy J. Gurney)
  1371. Date: Tue, 24 May 1994 23:23:40 GMT
  1372. Organization: Hewlett-Packard VCD
  1373.  
  1374. Scott Kaplan (sfkaplan@alife.santafe.edu) wrote:
  1375. >Hi there.   I'm writing a quick little program which needs to make use of the
  1376. >serial ports (specifically, the modem port attached to, of all things, a
  1377. >modem...).  
  1378. >For what this program is doing, it does not seem worth my time to figure out
  1379. >how to use the Comm Toolbox, so I thought I'd do it directly by opening the
  1380. >serial drivers and using good ol' FSRead and FSWrite.  I'm having trouble,
  1381. >and I was hoping someone could tell me why.
  1382.  
  1383. Check out the sample code on ftp.apple.com:
  1384.  
  1385. /dts/mac/sc/snippets/devices/pbxxx-serial-demo.hqx
  1386.  
  1387. The snippets directory is a GREAT place to look for answers to ALL of 
  1388. your questions BEFORE posting to net...
  1389.  
  1390. --
  1391. Eddy J. Gurney N8FPW   Hewlett-Packard Company, Vancouver (USA!) Division
  1392. egurney@vcd.hp.com                       #include <standard-disclaimer.h>
  1393. "Failures are divided into two classes-- those who thought and never did,
  1394.       and those who did and never thought."     John Charles Salak
  1395.  
  1396. +++++++++++++++++++++++++++
  1397.  
  1398. >From ab@crosfield.co.uk (Andrew Bradley)
  1399. Date: Thu, 26 May 1994 09:03:15 GMT
  1400. Organization: Crosfield, Hemel Hempstead, UK
  1401.  
  1402. In article <2rtmbt$o8m@tierra.santafe.ede> sfkaplan@alife.santafe.edu (Scott Kaplan) writes:
  1403. >Hi there.   I'm writing a quick little program which needs to make use of the
  1404. >serial ports (specifically, the modem port attached to, of all things, a
  1405. >modem...).  
  1406.  
  1407. >Here's the problem.  I've go to do an FSRead on the modem port.  If there is
  1408. >something waiting in the modem port's buffer, everything's great.  However,
  1409. >if there is nothing there (nothing has come in since I read from it last),
  1410. >I die.  Rather than returning a count of 0 bytes read in, and rather than
  1411. >returning some error value from FSRead, the machine crashes completely.  I
  1412. >have to reboot.  So, I am clearly doing something wrong here...
  1413. >
  1414.  
  1415.  
  1416. I use SerGetBuf to check whats available and read that in - if its zero
  1417. I use my own minimum data size because otherwise the FSRead will hang
  1418. until it got all the bytes you asked for.
  1419.  
  1420. Remember the Mac may be written in C but its not UNIX. You have to study
  1421. the Mac libraries very carefully and forget all your unix past !
  1422.  
  1423. Regards Andrew
  1424.  
  1425.  
  1426.  
  1427. -- 
  1428.  
  1429.  
  1430.   |\/\/\/\                   Andrew Bradley
  1431.   |      |                   Crosfield Electronics Limited
  1432.  
  1433. +++++++++++++++++++++++++++
  1434.  
  1435. >From cswan@actrix.gen.nz (Chris Swan)
  1436. Date: Thu, 26 May 1994 21:25:04 GMT
  1437. Organization: Actrix Information Exchange
  1438.  
  1439. Scott Kaplan <sfkaplan@alife.santafe.edu> wrote:
  1440. > Hi there.   I'm writing a quick little program which needs to make use of the
  1441. > serial ports (specifically, the modem port attached to, of all things, a
  1442. > modem...).  
  1443. > Here's the problem.  I've go to do an FSRead on the modem port.  If there is
  1444. > something waiting in the modem port's buffer, everything's great.  However,
  1445. > if there is nothing there (nothing has come in since I read from it last),
  1446. > I die.  Rather than returning a count of 0 bytes read in, and rather than
  1447. > returning some error value from FSRead, the machine crashes completely.  I
  1448. > have to reboot.  So, I am clearly doing something wrong here...
  1449.  
  1450. I'm not sure why you're crashing but the normal way is to call:
  1451.  
  1452. theError:= SerGetBuf(refNum,count);
  1453. if (theError=noErr) and (count>0) then
  1454.   theError:= FSRead(refNum,count,buffPtr);
  1455.  
  1456. works for me !
  1457. -- 
  1458. Chris Swan
  1459. cswan@actrix.gen.nz
  1460. --
  1461.  
  1462.  
  1463. +++++++++++++++++++++++++++
  1464.  
  1465. >From Bruce@hoult.actrix.gen.nz (Bruce Hoult)
  1466. Date: Fri, 27 May 1994 14:08:43 +1200 (NZST)
  1467. Organization: (none)
  1468.  
  1469. sfkaplan@alife.santafe.edu (Scott Kaplan) writes:
  1470. > Here's the problem.  I've go to do an FSRead on the modem port.  If there is
  1471. > something waiting in the modem port's buffer, everything's great.  However,
  1472. > if there is nothing there (nothing has come in since I read from it last),
  1473. > I die.  Rather than returning a count of 0 bytes read in, and rather than
  1474. > returning some error value from FSRead, the machine crashes completely.  I
  1475. > have to reboot.  So, I am clearly doing something wrong here...
  1476.  
  1477. The machine hasn't crashed -- it's just waiting for the data you asked for.
  1478.  
  1479. If you want your program to continue if there's nothing there then use...
  1480.  
  1481.    SerGetBuf(refNum:INTEGER;VAR count:LONGINT):OSErr;
  1482.     
  1483. ...to find out how many bytes are available, and then ask for at most
  1484. that many in your FSRead.
  1485.  
  1486. -- Bruce
  1487.  
  1488. btw, I just used ObiWan to paste the definition of SerGetBuf.  It's nice, but
  1489. what I *hate* about it is that the first time I use it after a restart, it
  1490. puts up a much larger window and all my Icons that are nicely arranged along
  1491. the bottom of my Finder desktop somehow get moved to the RH side of the desktop.
  1492.  
  1493. ::aaaarggghhhh::
  1494.  
  1495. +++++++++++++++++++++++++++
  1496.  
  1497. >From gurgle@netcom.com (Pete Gontier)
  1498. Date: Fri, 27 May 1994 21:33:37 GMT
  1499. Organization: cellular
  1500.  
  1501. ab@crosfield.co.uk (Andrew Bradley) writes:
  1502.  
  1503. >Remember the Mac may be written in C but its not UNIX.
  1504.  
  1505. I know it's a persistent rumor, but the Mac ROMs were not written in any
  1506. particular high-level language. I guess from now on the Power Mac ROMs
  1507. will mostly be written in C, or perhaps C++, but from what I understand,
  1508. much of that work has not yet been released. It's still mostly 68K
  1509. assembly using the Pascal calling convention.
  1510. -- 
  1511.  Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com
  1512.  
  1513.  "Bedrock does support a form of drag and drop. Development dragged on
  1514.  for about two years, and then was dropped." -- Brian Clark
  1515.  
  1516. +++++++++++++++++++++++++++
  1517.  
  1518. >From sfkaplan@alife.santafe.edu (Scott Kaplan)
  1519. Date: 29 May 1994 16:43:44 GMT
  1520. Organization: The Santa Fe Institute
  1521.  
  1522. Many thanks to those that responded!  I know now of a very useful place 
  1523. for sample source code from Apple, which will always be a good thing.  More-
  1524. over, I now know what I was doing wrong.  Sure enough, the use of SerGetBuf
  1525. fixed my troubles.
  1526.  
  1527. My apologies for not having read through the serial driver toolbox routines
  1528. more carefully.  It's been a little while since I had done Mac programming,
  1529. so I had fallen out of that good habit.
  1530.  
  1531. Scott Kaplan
  1532. sfkaplan@santafe.edu
  1533.  
  1534.  
  1535. ---------------------------
  1536.  
  1537. >From stevenj@ATHENA.MIT.EDU (Steven G. Johnson)
  1538. Subject: THINK Class Library FTP Site?
  1539. Date: 26 May 1994 18:32:48 GMT
  1540. Organization: Massachvsetts Institvte of Technology
  1541.  
  1542. There used to be an FTP site containing an archive of classes that
  1543. people have written for TCL.  It was connected to a mailing list
  1544. (called TCL-talk, I think), and was located at ftp.brown.edu.
  1545. However, I looked at this site today and I couldn't find anything!
  1546. Does anyone know what has happened to the archive (and the mailing
  1547. list)?  Has it been moved to someplace else?  If so, where?
  1548.  
  1549. Please email all responses, as it is difficult for me to read this
  1550. newsgroup at the moment.  I will post a summary of the replies if
  1551. anyone is interested.  Thanks!
  1552.  
  1553.                     Cordially,
  1554.                     Steven G. Johnson
  1555.  
  1556. +++++++++++++++++++++++++++
  1557.  
  1558. >From stevenj@ATHENA.MIT.EDU (Steven G. Johnson)
  1559. Date: 27 May 1994 16:28:35 GMT
  1560. Organization: Massachvsetts Institvte of Technology
  1561.  
  1562. I recently posted a request for the location of the FTP site
  1563. containing TCL classes and functions.  I was told that the new site
  1564. is:    daemon.ncsa.uiuc.edu  (I checked it out and this is indeed the
  1565. correct address).
  1566.  
  1567. Thanks to all who replied.
  1568.  
  1569.                         Cordially,
  1570.                         Steven G. Johnson
  1571.  
  1572. ---------------------------
  1573.  
  1574. >From Will Husain <whusain@azedlink1.state.az.us>
  1575. Subject: storage for XCMDS
  1576. Date: 23 May 1994 14:51:52 GMT
  1577. Organization: k12
  1578.  
  1579. I'd like to write an XCMD for hypercard that will store information
  1580. between successive calls from hypercard.  How can I keep track of global
  1581. data with this kind of resource?
  1582.  
  1583. Thanks for any suggestions
  1584.  
  1585. Will Glass-Husain
  1586. Catalina Foothills High School
  1587. whusain@k12.az.us
  1588.  
  1589. +++++++++++++++++++++++++++
  1590.  
  1591. >From alex@metcalf.demon.co.uk (Alex Metcalf)
  1592. Date: Tue, 24 May 1994 12:02:21 GMT
  1593. Organization: Best Before Yesterday
  1594.  
  1595. In article <2rqfu8$ffs@azedlink1.ade.state.az.us>, Will Husain
  1596. <whusain@azedlink1.state.az.us> wrote:
  1597.  
  1598. > I'd like to write an XCMD for hypercard that will store information
  1599. > between successive calls from hypercard.  How can I keep track of global
  1600. > data with this kind of resource?
  1601.  
  1602. You first need to make up your own struct of information which you want to
  1603. keep, something like this:
  1604.  
  1605. typedef struct
  1606. {
  1607.    Ptr    myMemory;
  1608.    long   myLong;
  1609.    short  myShort;
  1610. } MyData, *MyDataPtr;
  1611.  
  1612. So, you use NewPtr to make some space on the heap for your data. Then, you
  1613. take the pointer (to your data), typecast it to a 'long', use NumToString,
  1614. and store the string (which is actually the address of your info) in a
  1615. HyperCard global variable using SetGlobal.
  1616.  
  1617. Next time round, use GetGlobal, use StringToNum, and then typecast back to
  1618. a pointer. You can then access your information.
  1619.  
  1620. Hope this helps! Get in touch if you have any other questions.
  1621.  
  1622.  
  1623. Best wishes,
  1624.  
  1625.  
  1626.  
  1627.  
  1628. Alex
  1629.  
  1630. --
  1631. Alex Metcalf, Best Before Yesterday
  1632. Mac programmer in C, C++, HyperTalk, assembler
  1633.  
  1634. Internet, AOL, BIX: alex@metcalf.demon.co.uk            "Surely you
  1635. AppleLink:          alex@metcalf.demon.co.uk@internet#   can't be
  1636. CompuServe:         INTERNET:alex@metcalf.demon.co.uk    serious?"
  1637. Delphi:             alex@metcalf.demon.co.uk@inet#
  1638. FirstClass:         alex@metcalf.demon.co.uk,Internet   "I am serious...
  1639. Fax (UK):           (0570) 45636                         and don't call
  1640. Fax (US / Canada):  011 44 570 45636                     me Shirley."
  1641.  
  1642. +++++++++++++++++++++++++++
  1643.  
  1644. >From Arne.Venstad@DELAB.SINTEF.no (Arne Venstad)
  1645. Date: 25 May 1994 08:44:02 GMT
  1646. Organization: SINTEF DELAB
  1647.  
  1648. In article <alex-240594130138@metcalf.demon.co.uk>,
  1649. alex@metcalf.demon.co.uk (Alex Metcalf) wrote:
  1650. > In article <2rqfu8$ffs@azedlink1.ade.state.az.us>, Will Husain
  1651. > <whusain@azedlink1.state.az.us> wrote:
  1652. > > I'd like to write an XCMD for hypercard that will store information
  1653. > > between successive calls from hypercard.  How can I keep track of global
  1654. > > data with this kind of resource?
  1655. > You first need to make up your own struct of information which you want to
  1656. > keep, something like this:
  1657. > typedef struct
  1658. > {
  1659. >    Ptr    myMemory;
  1660. >    long   myLong;
  1661. >    short  myShort;
  1662. > } MyData, *MyDataPtr;
  1663. > So, you use NewPtr to make some space on the heap for your data. Then, you
  1664. > take the pointer (to your data), typecast it to a 'long', use NumToString,
  1665. > and store the string (which is actually the address of your info) in a
  1666. > HyperCard global variable using SetGlobal.
  1667. >...
  1668.  
  1669. I do not think it is wise to allocate locked memory blocks behind
  1670. the back of HyperCard. I would therefore suggest you use NewHandle
  1671. instead of NewPtr, and always unlock it before returning to HyperCard. 
  1672. Otherwise the schema is ok.
  1673.  
  1674. Arne Venstad    Internet: Arne.Venstad@delab.sintef.no
  1675. SINTEF DELAB,
  1676. N-7034 Trondheim,
  1677. Norway.
  1678.  
  1679. +++++++++++++++++++++++++++
  1680.  
  1681. >From alex@metcalf.demon.co.uk (Alex Metcalf)
  1682. Date: Wed, 25 May 1994 12:01:50 GMT
  1683. Organization: Best Before Yesterday
  1684.  
  1685. In article <Arne.Venstad-250594103928@mac-df17.er.sintef.no>,
  1686. Arne.Venstad@DELAB.SINTEF.no (Arne Venstad) wrote:
  1687.  
  1688. > In article <alex-240594130138@metcalf.demon.co.uk>,
  1689. > alex@metcalf.demon.co.uk (Alex Metcalf) wrote:
  1690. > > 
  1691. > > In article <2rqfu8$ffs@azedlink1.ade.state.az.us>, Will Husain
  1692. > > <whusain@azedlink1.state.az.us> wrote:
  1693. > > 
  1694. > > > I'd like to write an XCMD for hypercard that will store information
  1695. > > > between successive calls from hypercard.  How can I keep track of global
  1696. > > > data with this kind of resource?
  1697. > > 
  1698. > > You first need to make up your own struct of information which you want to
  1699. > > keep, something like this:
  1700. > > 
  1701. > > typedef struct
  1702. > > {
  1703. > >    Ptr    myMemory;
  1704. > >    long   myLong;
  1705. > >    short  myShort;
  1706. > > } MyData, *MyDataPtr;
  1707. > > 
  1708. > > So, you use NewPtr to make some space on the heap for your data. Then, you
  1709. > > take the pointer (to your data), typecast it to a 'long', use NumToString,
  1710. > > and store the string (which is actually the address of your info) in a
  1711. > > HyperCard global variable using SetGlobal.
  1712. > > 
  1713. > >...
  1714. > I do not think it is wise to allocate locked memory blocks behind
  1715. > the back of HyperCard. I would therefore suggest you use NewHandle
  1716. > instead of NewPtr, and always unlock it before returning to HyperCard. 
  1717. > Otherwise the schema is ok.
  1718.  
  1719. I've had problems before with NewHandle: HyperCard enjoys moving memory
  1720. around, especially when stacks are switched/closed. If HyperCard (or the
  1721. system memory fuctions) decide to purge your block then there's no way to
  1722. get your data back.
  1723.  
  1724.  
  1725.  
  1726. Alex
  1727.  
  1728. +++++++++++++++++++++++++++
  1729.  
  1730. >From Ron_Hunsinger@bmug.org (Ron Hunsinger)
  1731. Date: Wed, 25 May 94 22:52:20 PST
  1732. Organization: Berkeley Macintosh Users Group
  1733.  
  1734. Will Husain <whusain@azedlink1.state.az.us> writes:
  1735.  
  1736. >I'd like to write an XCMD for hypercard that will store information
  1737. >between successive calls from hypercard.  How can I keep track of global
  1738. >data with this kind of resource?
  1739.  
  1740. Store the data in a relocatable block, and convert the Handle to that
  1741. block to a string and store the string in a global variable.  (Choose a 
  1742. name that won't be used by somebody else.)
  1743.  
  1744. On entry to the XCMD, get the value of that variable.  If it doesn't 
  1745. have a value, you know this is the first call of the XCMD, and you should
  1746. allocate your data.  If the variable does have a value, convert it
  1747. back to a long, and cast it as a Handle to your data.
  1748.  
  1749. -Ron Hunsinger
  1750.  
  1751. +++++++++++++++++++++++++++
  1752.  
  1753. >From Kevin Marks <Kevin@pinner.demon.co.uk>
  1754. Date: Sat, 28 May 1994 11:08:05 GMT
  1755. Organization: Me
  1756.  
  1757. In article <001565AE.fc@bmug.org> Ron Hunsinger, Ron_Hunsinger@bmug.org
  1758. writes:
  1759. >Store the data in a relocatable block, and convert the Handle to that
  1760. >block to a string and store the string in a global variable.  (Choose a 
  1761. >name that won't be used by somebody else.)
  1762.  
  1763. This is a bit dodgy - you can't guarantee that someone else won't trash
  1764. your variable...
  1765. The best way is to write a XWindow instead, and store your Handle in the
  1766. window's refcon. You don't have to show the window if it's not working on
  1767. visual stuf, and thsi means you can send messages to it and set
  1768. properties, so your HyperTalk looks less obscure.
  1769.  
  1770. ---------------------------
  1771.  
  1772. End of C.S.M.P. Digest
  1773. **********************
  1774.  
  1775.  
  1776. ˇ